﻿using GalaSoft.MvvmLight.Command;
using Glorysoft.Auto.Xfw;
using Glorysoft.EAP.Core.Entities;
using Glorysoft.EAP.Core.Enums;
using Glorysoft.EAP.EAPClient.Common;
using Glorysoft.EAP.EAPClient.Model;
using Serilog.Core;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.Configuration;
using System.Linq;
using System.Windows;
using static Glorysoft.EAP.EAPClient.Model.SlotMap;

namespace Glorysoft.EAP.EAPClient.ViewModel
{
    /// <summary>
    /// This class contains properties that a View can data bind to.
    /// <para>
    /// See http://www.galasoft.ch/mvvm
    /// </para>
    /// </summary>
    public class RemindMessageViewModel : PopupWindowVM
    {
        private readonly Logger ServiceLogger = XfwContext.EapLogger;
        public delegate void CloseDelegate();
        public event CloseDelegate CloseEvent;
       
        public C_LotInfo c_LotInfo = null;
        /// <summary>
        /// Initializes a new instance of the LoginViewModel class.
        /// </summary>
        public  RemindMessageViewModel()
        {
            //RemindMessageBoxWindow window = null;
            //System.Windows.Application.Current.Dispatcher.Invoke(new Action(delegate
            //{
            //    Controller.ShowWindow(new RemindMessageBoxWindow());
            //}));
            RemindMessageBoxWindow window = null;
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                window = new RemindMessageBoxWindow();
            }));
            window.MessageBoxText = "EAP代操中，请勿操作设备";
            //window.OKButtonVisibility = Visibility.Visible;
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                window.Show();
               // window.ShowDialog();
                //window.Close();
            }));
           // return window.Result;
           // window.MessageBoxText = "aaaaaaaaaaaaaaaaaa";
            
        }
        public Model.RunService ClientInfo
        {
            get
            {
                return Model.RunService.Current;
            }
        }
        private void ClosingMessage()
        {
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
               RemindMessageBoxWindow window =null;
                window.Close();
                // window.ShowDialog();
                //window.Close();
            }));
        }
     } 
   
}